package com.web.remark;

import com.service.RemarkService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class DeleteRemarkServlet extends HttpServlet {
    @Override
    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    @Override
    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        RemarkService service=new RemarkService();
        int id=Integer.valueOf(req.getParameter("id"));
        service.deleteremark(id);
        req.getRequestDispatcher("/DisplayRemark").forward(req, resp);
    }
}
